package bairui.international.console.web.controller.authority.authorization.role.operator;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.ResponseBody;

import com.lianjing.sh.spring.web.controller.base.action.Action;
import com.lianjing.sh.spring.web.controller.enhance.output.FomatOutput;

import bairui.international.model.domain.jpa.TB_Admin;
import bairui.international.service.Service_Admin;


/**
 *
 * 移除操作者
 *
 * @generated
 * 
 * @see Test_C_Admin_Authority_Authorization_Role_OperatorRemove_Page 测试
 *
 */
@Controller
public class C_Admin_Authority_Authorization_Role_OperatorRemove_Page
 extends SC_Admin_Authority_Authorization_Role_OperatorRemove_Page 
{

	
	@Autowired private Service_Admin service_Admin;
	
	/**
	 * 分页列表
	 */
	@Action(Page.class)
	@GetMapping(value=Page.RequestMappingValue, consumes=MediaType.APPLICATION_JSON_VALUE)
	public @FomatOutput @ResponseBody Object page(
		HttpServletRequest request, 
		@PathVariable(name=Page.PathVariableName.RoleId) long roleId
	) throws Exception {
		org.springframework.data.domain.Page<TB_Admin> page = service_Admin.page(
				it->Page.Filter.query(it, request)
					.and(it.roles.any().id.eq(roleId)), 
				Page.Output.page(request), 
				it->Page.Output.sort(it, request)
			);
		//
		return Page.Output.output(
				page
			);
	}
	

}


